package com;

import com.lagou.service.UserServiceImpl;
import com.lagou.utils.SpringUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Import;

/**
 * @Author wyx
 * @Date 2020/3/14 17:49
 */
@Import(SpringUtil.class)
@SpringBootApplication
public class ServerBootstrap {
//    private static ApplicationContext applicationContext;

    public static void main(String[] args) throws InterruptedException {

        SpringApplication.run(ServerBootstrap.class, args);

        ApplicationContext applicationContext = SpringUtil.getApplicationContext();
        UserServiceImpl userService =   applicationContext.getBean(UserServiceImpl.class);
        userService.startServer("127.0.0.1",8990);



    }
}
